const express = require('express');
// const moment = require('moment');
const db = require('./操作sql');
// 创建路由 实例对象
const router = express.Router();

router.get('/:id', (req, res)=> {
    // let result = req.params.id;
    console.log(`有人访问啦：${req.startTime}!接口为：${req.params.id}`)
    db.query(`SELECT * FROM ClassCourse WHERE id= ${req.params.id}`,(err, data, fields)=>{
        res.send(data);
    });
})
// router.get('/send',(req,res)=>{
//     console.log(`有人访问啦！${req.startTime}`);
// });
module.exports = router;